com.jproxy.proxy
Class TunnelInvocationHandler

java.lang.Object
  |
  +--com.jproxy.proxy.TunnelInvocationHandler
All Implemented Interfaces:
java.io.Serializable

public class TunnelInvocationHandler
extends java.lang.Object
implements java.io.Serializable

Implementation of InvocationHandler used by DynamicProxyStub. The class implements handler for remote interface. All methods of remote interface are delegated to the handler. The class supports packaging requests with DataStack. It also recognizes Callbacks and creates for them proxies stubs. The class is used by client and created by Tunneling server.

See Also:
Invocator, Tunnel, Proxy, Serialized Form

Field Summary
 java.lang.Object object
          URL of Tunneling server that created the object
 
Constructor Summary
TunnelInvocationHandler(java.lang.String[] _interfaceNames, long _objectId, java.lang.String _objectClassName, Tunnel _tunnel)
          Constructor for TunnelInvocationHandler
 
Method Summary
 java.lang.String[] getInterfaceNames()
          Tunnelizable implementation
 java.lang.String getObjectClassName()
           
 long getObjectId()
          Tunnelizable implementation
 Tunnel getTunnel()
          Tunnelizable implementation
static TunnelInvocationInterceptor getTunnelInvocationInterceptor()
           
 java.lang.Object invoke(Tunnelizable proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          The implementation of InvocationHandler Processes a method invocation on a proxy instance and returns the result.
 java.lang.Object invokeMethod(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          The method delegates calls to Tunnel object.
static void setTunnelInvocationInterceptor(TunnelInvocationInterceptor interceptor)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

public transient java.lang.Object object
URL of Tunneling server that created the object
Constructor Detail

TunnelInvocationHandler

public TunnelInvocationHandler(java.lang.String[] _interfaceNames,
                               long _objectId,
                               java.lang.String _objectClassName,
                               Tunnel _tunnel)
                        throws TunnelException
Constructor for TunnelInvocationHandler
Parameters:
interfaceNames - the names of remote interfaces for which methods are delegated to the handler
objectId - embedded remote object id
clientUrl - URL of client
tunnel - Tunnel object
Method Detail

setTunnelInvocationInterceptor

public static void setTunnelInvocationInterceptor(TunnelInvocationInterceptor interceptor)

getTunnelInvocationInterceptor

public static TunnelInvocationInterceptor getTunnelInvocationInterceptor()

invoke

public java.lang.Object invoke(Tunnelizable proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
The implementation of InvocationHandler Processes a method invocation on a proxy instance and returns the result. The method implements virtual method for Object class of the stub.
Parameters:
proxy - the proxy instance that the method was invoked on
method - the Method instance corresponding to the interface method invoked on the proxy
args - an array of objects containing the values of the arguments passed in the method

getObjectId

public long getObjectId()
Tunnelizable implementation

getTunnel

public Tunnel getTunnel()
Tunnelizable implementation

getInterfaceNames

public java.lang.String[] getInterfaceNames()
Tunnelizable implementation

getObjectClassName

public java.lang.String getObjectClassName()

invokeMethod

public java.lang.Object invokeMethod(java.lang.Object proxy,
                                     java.lang.reflect.Method method,
                                     java.lang.Object[] args)
                              throws java.lang.Throwable
The method delegates calls to Tunnel object. The method supports packaging requests with DataStack. It also recognizes Callbacks and creates for them proxies stubs.
Parameters:
proxy - Proxy stub object
method - reflected method of the proxy
args - arguments for method call


Copyright ⌐ JProxy LLC. All Rights Reserved.